#!/usr/bin/env python3
"""运行真实的数据库服务器"""

import sys
import os

# 添加项目根目录到Python路径
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../')))

from src.server.server import DatabaseServer

def main():
    """主函数"""
    print("启动RBDB数据库服务器（集成execution模块）...")
    
    server = DatabaseServer()
    try:
        server.start()
    except KeyboardInterrupt:
        print("\n收到中断信号，正在关闭服务器...")
        server.stop()
    except Exception as e:
        print(f"服务器运行出错: {e}")
        server.stop()

if __name__ == "__main__":
    main()